package com.open4cn.simulator.core.answer;

import java.io.Serializable;

/**
 * @author yinxiaopeng
 * @version 1.0.0
 * @company 致景科技
 * @department 飞梭BU/研发
 * @description
 * @Email yinxiaopeng@zj.tech
 * @date 2022-05-05 13:52
 */
public class AnswerResponse implements Serializable {

    private boolean success;

    private Object data;

    private AnswerResponse() {
    }

    private AnswerResponse(boolean success, Object data) {
        this.success = success;
        this.data = data;
    }


    public static AnswerResponse success(Object data) {
        return new AnswerResponse(true, data);
    }

    public static AnswerResponse fail(Object data) {
        return new AnswerResponse(false, data);
    }

    public boolean isSuccess() {
        return success;
    }

    public Object getData() {
        return data;
    }
}
